package com.zhinong.mapper;

import com.github.pagehelper.Page;
import com.zhinong.dto.OrderPageQueryDTO;
import com.zhinong.entity.Order;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface OrderMapper {
    Page<Order> pageQuery(OrderPageQueryDTO orderPageQueryDTO);


    @Delete("delete from `order` where id = #{id}")
    void deleteById(long id);

    @Insert("insert into `order`(id,name,store_name,user_id,type,number,price,address,status,picture)values(#{id},#{name}, #{storeName}, #{userId}, #{type}, #{number}, #{price}, #{address}, #{status}, #{picture})")
    void insert(Order order);

    void update(Order order);
}
